<div class="container">
	<h3>Users</h3>
	<table class="table">
		<tr>
			<th>id</th>
			<th>Nombre</th>
			<th>Usuario</th>
			<th>Correo</th>
			<th></th>	
			<th></th>	
			<th></th>	
		</tr>

		<% _.each(users, function(user){ %>
			<tr dara-id="<%= user.id %>" data-model="user">
				<td><%= user.id %></td>
				<td><%= user.name %></td>
				<td><%= user.username %></td>
				<td><%= user.email %></td>
				<% if (user.admin){ %> 
				<td><img src="/images/admin.png" alt=""></td>
				<% } else { %>
				<td><img src="/images/user.png" alt=""></td>
				<% } %>
				<td><a href="/user/show/<%= user.id%>" class="btn btn-sm btn-primary">Show</a></td>
				<td><a href="/user/edit/<%= user.id%>" class="btn btn-sm btn-warning">Edit</a></td>

				<td>
					<form action="/user/destroy/<%= user.id%>" method="POST">
						<input type="hidden" name="method" value="delete">
						<input type="submit" class="btn btn-sm btn-danger" value="Delete">
						<input type="hidden" name="_csrf" value="<%= _csrf %>">
					</form>
				</td>
			</tr>
		<% }) %>
	</table>
</div>